vcComponentSignal
Component signal is a signal that can send a component objects.
See in: Overview
Module: vcBehaviors
Parent: vcSignal
Children -
Referenced by: vcComponentFlowProxy.ComponentSignal, vcComponentPathSensor.ComponentSignal, vcRaycastSensor.ComponentSignal, vcVolumeSensor.ComponentSignal
Properties
Learn how to use properties here. The properties are also inherited from the parent class.
| Name | Type | Access | Description |
| Value | vcComponent | RW | Gets or sets the value of signal. Note, setting this value does not trigger 'OnSignal' event. If event trigger is required, use signal(value) method. |
Methods
Learn how to use methods here. The methods are also inherited from the parent class.
| Name | Return Type | Parameters | Description |
| signal | None | vcComponent OR None value | Sets the signal value and signals it to all connected behaviors.See moreParameters: value: The value set for this signal and signaled to connected behaviors. |
| waitFor | object | vcComponent OR None value, Optional Keyword[waitTrigger = Boolean] | Blocks script execution until vcSignal.Value is equal to the "value".See moreThis function returns an awaitable task. It must be awaited. Parameters: value (object): Value that is used for comparison. When the value is equal to vcSignal.Value, the task completes. Optional: waitTrigger (boolean): False by default. When waitTrigger is True, the task will wait for the value to change first, before comparing it against "value". Otherwise, the comparison is done immediately and when the values match, the task will complete without blocking the script. Returns: Awaitable[List]: The task instance. When awaited, returns a list of event arguments that the event has been triggered with. |
| waitForNot | object | vcComponent OR None value, Optional Keyword[waitTrigger = Boolean] | Blocks script execution until vcSignal.Value is not equal to the "value".See moreThis function returns an awaitable task. It must be awaited. Parameters: value (object): Value that is used for comparison. When the value is not equal to vcSignal.Value, the task completes. Optional: waitTrigger (boolean): False by default. When waitTrigger is True, the task will wait for the value to change first, before comparing it against "value". Otherwise, the comparison is done immediately and when the values do not match, the task will complete without blocking the script. Returns: Awaitable[List]: The task instance. When awaited, returns a list of event arguments that the event has been triggered with. |
Example: Wait Component Signal Value
"""Waits for a component signal to change its value.""" import vcCore as vc async def OnRun(): comp = vc.getComponent() signal = comp.findBehavior("ComponentSignal") # signal must be connected to this script await signal.waitForNot(None) print('Signal triggered high') await signal.waitFor(None) print('Signal triggered low')